@extends('admin.layouts.app')
@section('content')

                        <div class="row">
                            <div class="col-sm-12">
                                <h4 class="page-title">工单管理</h4>
                                <ol class="breadcrumb">
                                    <li><a href="#">系统</a></li>
                                    <li><a href="{{url('zadmin/consults')}}">工单管理</a></li>
                                    <li class="active">工单详情</li>
                                </ol>
                            </div>
                        </div>
                        
                        <div class="row">
                        	<div class="col-lg-12">
                        		<div class="card-box">
                            <h2 class="m-t-0 header-title">工单详情</h2>
                            <hr/>
                             
      <div class="row">
			   <div class="col-md-9">
                                 
            <table class="table table-hover">
                <tr>
                  <td>编号</td>
                  <td><strong>{{$data->code}}</strong></td>
                </tr>
                <tr>
                  <td>标题</td>
                  <td><strong>{{$data->title}}</strong></td>
                </tr>
                <tr>
                  <td>故障内容</td>
                  <td>{{$data->contents}}</td>
                </tr>
                <tr>
                  <td>图片</td>
                  <td><img src="{{$data->thumb}}" width="600" /></td>
                </tr>
               
                <tr>
                  <td>咨询时间</td>
                  <td>{{$data->created_at}}</td>
                </tr>
                
               
              </table>
            </div>

            <div class="col-md-3">
                <table class="table table-hover">
                <tr>
                  <td>姓名</td>
                  <td>{{object_get($wxuser,'truename')}}</td>
                </tr>
                <tr>
                  <td>手机号</td>
                  <td>{{object_get($wxuser,'mobile')}}</td>
                </tr>
                <tr>
                  <td>单位</td>
                  <td>{{object_get($wxuser,'danwei')}}</td>
                </tr>
                <tr>
                  <td>职位</td>
                  <td>{{object_get($wxuser,'zhiwei')}}</td>
                </tr>
                
              </table>
            </div>

           
          </div>
              <hr/>
              @if($data->replies)
              <div class="row">
              <h4>回复列表</h4>       
                     <div class="col-md-12">
                     <table class="table">
                      <tr>
                        <th>回复人</th>
                        <th>内容</th>
                        <th>回复时间</th>
                        
                      </tr>
                       @foreach($data->replies as $r)
                       <tr>
                        <td>
                      {{$r->type==1?'我':object_get($wxuser,'truename')}}  
                    </td>
                      <td>
                        {{$r->contents}} &nbsp;&nbsp; 
                        </td>
                     
                      <td>{{$r->created_at}}               
                      </td>
                      </tr>
                       @endforeach
                        </table>
                     </div>
                </div>  
              @endif  

              <div class="row">
                <h4>回复</h4>
                <div class="col-md-12">
                 <form method="post" action="{{url('zadmin/consults/save-reply')}}" enctype="multipart/form-data" name="form1">
                  <div class="form-group m-b-20">
                    <label>内容 <span class="text-danger">*</span></label>
                    <textarea class="form-control" rows="5" name="contents" required="">{{old('contents')}}</textarea>
                  </div>
                  <div class="form-group text-center">                                              
                      <button type="submit" class="btn btn-info waves-effect waves-light">保存</button>
                  </div>
                  <input type="hidden" name="consult_id" value="{{$data->id}}"/>
                  <input type="hidden" name="type" value="1"/>
                  {{csrf_field()}}
                 </form>
                 
              </div>           	
			</div>
    </div>
                                
</div> <!-- end col -->

                            
                      
@endsection
                        
  @section('js')
  <script src="{{asset('admin/js/jquery.printPage.js')}}"></script>
  <script type="text/javascript">
      $(document).ready(function() {
        $(".btnPrint").printPage({
          url:"{{url('zadmin/task/print',$data->id)}}",
          attr:"href",
        });
      });

   
    
  </script>


@endsection                      
                        

                  
            
        
       

           



    
        
    
